#pragma once
#include "PersonList.h"
#include "Couple.h"
class Dating
{
private:
	int numOfMatches;
public:
	PersonList boys;
	PersonList girls;
	ContainerList<Couple> couples;

	Dating(void)
	{
		this->numOfMatches = 0;
	}

	~Dating(void)
	{
	}


	void InputMatches()
	{
		cout << "Enter desiered amount of interests to match: ";
		cin >> this->numOfMatches;
		cout << endl;
	}

	int MatchInterests( Person girl, Person boy )
	{
		int matches = 0;
		if( girl.interests.movies == boy.interests.movies )
				matches++;
		if( girl.interests.dance == boy.interests.dance )
				matches++;
		if( girl.interests.sports == boy.interests.sports )
				matches++;
		if( girl.interests.travel == boy.interests.travel )
				matches++;
		if( girl.interests.animals == boy.interests.animals )
				matches++;
		if( girl.interests.gaming == boy.interests.gaming )
				matches++;

		return matches;

	}

	void MatchPersons()
	{
		int size = girls.Size();

		for( int i = 0; i < size; i++ )
		{
			Person girl = girls.Pop();

			for( auto boy : boys )
			{
				if( MatchInterests( girl, boy.info ) >= numOfMatches )
				{
					couples.Add( Couple( boy.info, girl ) );
					boys.Remove( boys.Search( boy.info ) );
					break;
				}
			}

		}

	}

	int GetNumOfMatches() { return this->numOfMatches; }
	void SetNumOfMatches( int matches ) { this->numOfMatches = matches; }
};

